﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebHzt_Api.Models.Database;

namespace Hzt_WebApi.service
{
    public class UserService:IUserService
    {
        public readonly Hzt_WebApiContext _db;
        public UserService(Hzt_WebApiContext db)
        {
            _db = db;
        }
        /// <summary>
        /// 获取用户名
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        public User GetUserByUserName(string email)
        {
            var user = _db.Users.FirstOrDefault(x => x.Email == email);
            return user;
        }
    }
}
